﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Betop.Lib.Data;

namespace Betop.Lib.Core.Log.Operate
{
    public partial class LogOperateInfo : EntityBase
    {
        public override string GetTableName()
        {
            return "LogOperate";
        }
        public override string GetInsertSql()
        {
            return "insert into LogOperate ( [ID], [UserID], [UserName], [LoginName], [InputTime], [OperateType], [TableName], [Remark]) values ( @ID, @UserID, @UserName, @LoginName, @InputTime, @OperateType, @TableName, @Remark)";
        }
        public override string GetUpdateSql()
        {
            return "update LogOperate set  [ID] = @ID, [UserID] = @UserID, [UserName] = @UserName, [LoginName] = @LoginName, [InputTime] = @InputTime, [OperateType] = @OperateType, [TableName] = @TableName, [Remark] = @Remark where ID = @ID";
        }
        /// <summary>
        /// 
        /// </summary>
        public Guid ID
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 UserID
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public String UserName
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public String LoginName
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public DateTime InputTime
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 OperateType
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public String TableName
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public String Remark
        {
            get;
            set;
        }
        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Guid)value;
                    break;
                case "userid":
                    this.UserID = (Int32)value;
                    break;
                case "username":
                    this.UserName = (String)value;
                    break;
                case "loginname":
                    this.LoginName = (String)value;
                    break;
                case "inputtime":
                    this.InputTime = (DateTime)value;
                    break;
                case "operatetype":
                    this.OperateType = (Int32)value;
                    break;
                case "tablename":
                    this.TableName = (String)value;
                    break;
                case "remark":
                    this.Remark = (String)value;
                    break;
            }
        }
        public override object GetValue(string key)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    return this.ID;
                case "userid":
                    return this.UserID;
                case "username":
                    return this.UserName;
                case "loginname":
                    return this.LoginName;
                case "inputtime":
                    return this.InputTime;
                case "operatetype":
                    return this.OperateType;
                case "tablename":
                    return this.TableName;
                case "remark":
                    return this.Remark;
                default:
                    return null;
            }
        }
    }


}
